<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<jsp:useBean id="bdao" class="jwj8508.j2ee.basic.projectv5.dao.BoardDAO" scope="application" />
<style type="text/css">				
	table {	width: 70%;	margin: 0 auto;	border-collapse: collapse; table-layout: fixed; }
	th,td {	border: 1px solid black; padding: 10px; text-align: center;	}
	.bdtitle { text-align: left; white-space: nowrap; overflow: hidden;	text-overflow: ellipsis; }
	.cpage { font-size: 2em; font-weight: bold;	color: red; }
	.center { text-align: center; }
</style>
<div id="content">
	<h2>게시판</h2>			
	<table>
		<colgroup>
			<col style="width: 10%" />
			<col />
			<col style="width: 15%" />
			<col style="width: 15%" />
			<col style="width: 10%" />
		</colgroup>
		<!-- 제목행 시작 -->
		<tr><th>번호</th><th>제목</th><th>작성자</th><th>작성일</th><th>조회</th></tr>
		<!-- 제목행 끝 -->		
		<!-- 본문행 출력 시작 -->
		<c:forEach var="b" items="${bdao.listBoard() }">
		<tr>
			<td>${b.bdno }</td>
			<td class="bdtitle">
				<a href="?action=view&bdno=${b.bdno }">
					${b.title }
				</a>
			</td>
			<td>${b.uid }</td>
			<td>${fn:substring(b.wdate, 0, 10) }</td>
			<td>${b.reades }</td>
		</tr>		
		</c:forEach>
		<!-- 본문행 출력 끝 -->
	<tr><td colspan="5" style="border: none; text-align: right;">
		<button type="button" onclick="location.href='?action=write';">글쓰기</button></td>
	</tr>
	</table>
	<p class="center">◀  ◁◁ <span class="cpage">1</span> 2 3 4 5 6 7 8 9 ▷▷ ▶</p>
</div> <!-- content -->